import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
// import home from '../views/home.vue'//引入页面

const routes = [
    {
      path:'/',
      name:'home',
      component: () => import('../views/home.vue'),
      // component:home,
      redirect:'/wechat',
      children:[//子路由路由懒加载的方式
        {
          path:'fri',
          name:'fri',
          component: () => import('../views/fri.vue'),
          meta:{
            isShowFooter:true,
            title:'朋友圈',
            showFot:true
          },
        },
        {
          path:'mail',
          name:'mail',
          component: () => import('../views/mail.vue'),
          meta:{
            isShowFooter:true,
            title:'联系人',
            // showFot:true
          },
        },
        {
          path:'my',
          name:'my',
          component: () => import('../views/my.vue'),
          meta:{
            isShowFooter:false,
            title:'我的',
            // showFot:true
          },
        },
        {
          path:'wechat',
          name:'wechat',
          component: () => import('../views/wechat.vue'),
          meta:{
            isShowFooter:true,
            title:'微信',
            // showFot:true
          },
        },
        {
          path:'myFri',
          name:'myFri',
          component: () => import('../views/myFri.vue'),
          meta:{
            isShowFooter:false,
            title:'我的朋友圈',
            showFot:false
          },
        },
      ]
    },
    
]

const router = new VueRouter({
  mode:'history',
  base:'/',
  routes//声明路由表
});

  export default  router //导出路由对象